package utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * TODO
 *
 * @author chenwb25485
 * @version V2.1
 * @since 2021/1/15 15:55
 */
public class PhoneUtil {
    /**
     * 校验手机号的正则
     * @param phoneNum
     * @return {@code true}: 匹配<br>{@code false}: 不匹配
     */
    public static boolean checkPhoneNum(String phoneNum) {
        if (phoneNum ==null) {
            return false;
        }
        Pattern p = Pattern.compile("^1[3|4|5|7|8][0-9]{9}$");
        Matcher m = p.matcher(phoneNum.trim());
        return m.matches();
    }
}
